<%@ page language="java" contentType="text/html; charset=UTF-8"%>   
<html>   
<head>   
    <title>Struts2 File Upload</title>   
</head>   
<body>
    <div style="text-align:center;color:red;">${res}</div>
    <div style="fload:left;margin:50px 266px;">
	    <form action="/Atp/version/upload.action" method="POST" enctype="multipart/form-data">   
	        版本号：<input name="version.version" size="50" type="text" id="version_version"><br>   
	        选择文件：<input name="eicp" size="50" type="file" id="eipc_file" ><br> 
	       <input value=" 上传 " type="submit" onclick="return doCheck();">          
	    </form>
    </div> 
    <script>
         var doCheck = function(){
        	 var strP=/^\d+(\.\d+)?$/; 
             var v = document.getElementById("version_version").value;
             if(!v||v==""||!strP.test(oNum)){
                 alert("版本号为空或格式不对！");
                 return false;
             }
             try{
	             var file = document.getElementById("eipc_file").files[0].fileName;
                 if(file.indexOf(".apk") != (file.length-4)){
                	 alert("文件类型不对！");
                     return false;
                 }
             }catch(e){
             }
             return true;
         }
    </script>
</body>   
</html>
